package ru.spb.osll.myfit.client.dialog;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

public class AddContentDialog extends InputDialog {


  public AddContentDialog(DialogEventListener listener) {
	  super(listener);
	  //comment.
	  setText("Enter content:");
	  defineItems();
	}

	public void defineItems() {
	  m_cbButtonOk.setText("Add");

    m_cbButtonOk.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (!m_suggestBox.getText().isEmpty()){
          m_listener.createElement(m_suggestBox.getText(), m_sourceEvent);
        }
        hide();
        m_sourceEvent = null;
      }
    });
	}


}